﻿#include<iostream>
#include<vector>

int num = 0;
int* p = NULL;

void test01()
{
	std::vector<int> v1;
	v1.reserve(100000);
	for (int i = 0; i < 100000; ++i)
	{
		v1.push_back(i);	
		if (p != &v1[0])
		{
			p = &v1[0];
			num++;
		}
	}
	std::cout << "内存扩展次数：" << num << '\n';
}


int main()
{
	test01();




	return 0;
}